#define _CRT_SECURE_NO_WARNINGS//A=2 B=3
//#include<stdlib.h>
//#define MAX_SIZE 5
//struct _Record_Struct
//{
//	unsigned char Env_Alarm_ID : 4;
//	unsigned char Para1 : 2;
//	unsigned char state;//3
//	unsigned char avail : 1;
//}*Env_Alarm_Record;
//struct _Record_Struct* pointer = (struct _Record_Struct*)malloc(sizeof(struct _Record_Struct) * MAX_SIZE);


#include<stdio.h>
int main() {
    int a = 0;
    scanf("%4d", &a);
    for(; a+9 > 9;)
    {
        printf("%d", a % 10);
        a = a / 10;
    }
    return 0;
}